<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:replace="common/header::common_head"></head>
<link rel="stylesheet" href="../bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
<link href="../dist/css/datePicker.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<title>客户管理</title>

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <div th:replace="common/LeftCommon::common_top_left"></div>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <div>
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    客户管理
                </h1>
                <ol class="breadcrumb">
                    <li><a href="/index"><i class="fa fa-dashboard"></i>首页</a></li>
                    <li><a href="#">销售</a></li>
                    <li class="active">客户管理</li>
                </ol>
            </section>
            <!-- Main content -->
            <section class="content">
                <div class="col-md-4">
                    <!--左上方导航-->
                    <div class="box box-primary">
                        <div style="border-top: 1px solid #d7d7d7;border-bottom: 1px solid #d7d7d7;width: 100%;margin-bottom: 10px;text-align: center;padding-top: 8px;padding-bottom:8px;">
                            <span class="title">客户欠款汇总</span>&nbsp;&nbsp;&nbsp;&nbsp;
                            <span class="text" style="color:red;font-size: 1.2em">￥ 0.00</span>
                        </div>

                        <form>
                            <div class="box-body">
                                <table id="example2" class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>操作</th>
                                        <th>客户名称</th>
                                        <th>类型</th>
                                        <th>欠款</th>
                                        <th>积分</th>
                                        <th>状态</th>
                                        <th>建立时间</th>
                                        <th>排序</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr th:each="customers: ${customers}">
                                        <td><a href="javascript:void(0)" th:onclick="javascript:deleteCustomer([[${customers.id}]])">
                                            <span class="fa fa-fw fa-trash-o"></span>
                                        </a></td>
                                        <td><a th:text="${customers.name}" th:href="@{'custom_management?name=' + ${customers.name}}"></a></td>
                                        <td th:if="${customers.type} == 0">重点客户</td>
                                        <td th:if="${customers.type} == 1">普通客户</td>
                                        <td th:if="${customers.type} == 2">小客户</td>
                                        <td th:if="${customers.type} == 3">默认客户</td>
                                        <td th:if="${customers.type} == 4">新客户</td>
                                        <td th:text="${customers.debt}"></td>
                                        <td th:text="${customers.integral}"></td>
                                        <td th:if="${customers.status} == true">启用</td>
                                        <td th:if="${customers.status} == false">失效</td>
                                        <td th:text="${#dates.format(customers.settime, 'yyyy-MM-dd  HH:mm:ss')}"></td>
                                        <td th:text="${customers.sort}"></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer clearfix">
                                <ul class="pagination pagination-sm no-margin pull-right">
                                    <li><a href="#">&laquo;</a></li>
                                    <li><a href="#">1</a></li>
                                    <li><a href="#">2</a></li>
                                    <li><a href="#">3</a></li>
                                    <li><a href="#">&raquo;</a></li>
                                </ul>
                            </div>
                        </form>

                    </div>
                    <!-- /.box -->
                </div>
                <div class="col-md-8" th:if="${customer} eq null">
                    <div class="box">
                        <div class="box-header"  style="border-bottom: 1px dashed #ddd;">
                            <h3 class="box-title">基本信息 </h3>
                            <div style="float: right ">
                                <button type="button" class="btn btn-block btn-info" id="excell" onclick="method5('example2')">导出</button>
                            </div>
                            <div style="float: right ;margin-right:8px">
                                <a href="/sale/custom_management" style="color: white"> <button type="button" class="btn btn-block btn-info">新增客户</button></a>
                            </div>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <div class="panel-body">

                                    <!-- 表单开始 -->
                                    <div>
                                        <form class="form-horizontal" name="edit" id="pc" novalidate="">
                                            <div>
                                                <table class="table table-bordered " id="pcPage" style="display: none">
                                                    <tbody><tr>
                                                        <td class="col-xs-2 text-right"><span class="text-danger">* </span>客户名称：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" maxlength="30" id="name" name="name" class="form-control ng-pristine ng-valid-ng-remote-validate ng-invalid ng-invalid-required" required="" ng-change="changeSmCall()">
                                                            </div>
                                                        </td>

                                                        <td class="col-xs-2 text-right">客户类型：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-7 ">
                                                                <div style="display:inline-block;">
                                                                    <select class="form-control ng-pristine ng-valid" id="type" name="type">
                                                                        <option value="0">重点客户</option>
                                                                        <option value="1">普通客户</option>
                                                                        <option value="2">小客户</option>
                                                                        <option value="3">默认客户</option>
                                                                        <option value="4">新客户</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">手机：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="mobilephone" maxlength="128" name="mobilephone" class="form-control ng-pristine ng-valid ng-valid-pattern" placeholder="短信发送相关">
                                                            </div>
                                                        </td>

                                                        <td class="col-xs-2 text-right">昵称：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="nickname" maxlength="20" name="nickname" class="form-control ng-pristine ng-valid" placeholder="xxx先生/女士">
                                                            </div>
                                                        </td>

                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">性别：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input class="sel-a ng-pristine ng-valid" type="radio" id="sex" name="sex" checked="true" value=0>男
                                                                &nbsp;&nbsp;
                                                                <input class="sel-a ng-pristine ng-valid" type="radio" id="sex" name="sex" value=1>女
                                                            </div>
                                                        </td>
                                                        <td class="col-xs-2 text-right">生日：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 form-group validate_input">
                                                                <div class="input-group date">
                                                                    <div class="input-group-addon">
                                                                        <i class="fa fa-calendar"></i>
                                                                    </div>
                                                                    <input type="text" class="form-control pull-right" id="datepicker" name="birthday">
                                                                </div>
                                                            </div>
                                                        </td>

                                                    </tr>

                                                    <tr>
                                                        <td class="col-xs-2 text-right">启用：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-4 validate_input">
                                                                <select name="status" style="width: auto" class="form-control ng-pristine ng-valid"  id="status">
                                                                    <option value="0">失效</option>
                                                                    <option value="1">启用</option>
                                                                </select>
                                                            </div>
                                                        </td>

                                                        <td class="col-xs-2 text-right">联系人：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="contacts" maxlength="20" name="contacts" class="form-control ng-pristine ng-valid">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">电话：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="phone" maxlength="128" name="phone" class="form-controlng-pristine ng-valid ng-valid-pattern" placeholder="短信发送相关">
                                                            </div>
                                                        </td>

                                                        <td class="col-xs-2 text-right">邮箱：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="mail" id="mail" maxlength="128" name="mail" class="form-control ng-pristine ng-valid ng-valid-email">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>

                                                        <td class="col-xs-2 text-right">传真：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="fax" maxlength="128" name="fax" class="form-control ng-pristine ng-valid ng-valid-pattern">
                                                            </div>
                                                        </td>

                                                        <td class="col-xs-2 text-right">银行账户：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="bankaccount" maxlength="128" name="bankaccount" class="form-control ng-pristine ng-valid">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">银行账号：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="banknumber" maxlength="128" name="banknumber" ng-pattern="/^[0-9]*$/" class="form-control ng-pristine ng-valid ng-valid-pattern">
                                                            </div>
                                                        </td>

                                                        <td class="col-xs-2 text-right">开户行：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 ">
                                                                <input type="text" id="openbank" maxlength="128" name="openbank" class="form-control ng-pristine ng-valid">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right ng-binding">
                                                            <span class="text-danger">* </span>
                                                            默认折扣(%)：
                                                        </td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-3 validate_input" style="height: 42px;">
                                                                <input type="number" id="discount" maxlength="128" style="width: auto" name="discount" min="-0.001" max="10000" ng-pattern="/^\d{0,5}\.?[0-9]{0,2}$/" class="form-control ng-pristine ng-valid-number ng-valid-max ng-valid-min ng-valid-pattern ng-valid ng-valid-required">
                                                            </div>
                                                        </td>

                                                        <td class="col-xs-2 text-right">建立时间：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9">
                                                                <p id="createTime1" name="createTime1"></p>
                                                            </div>
                                                        </td>
                                                    </tr>

                                                    <tr>
                                                        <td class="col-xs-2 text-right"><span class="text-danger">* </span>排序：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-3 validate_input">
                                                                <input type="number" style="width: auto" id="sort" max="1000000" name="sort" min="1" class="form-control ng-pristine ng-valid-number ng-valid-max ng-valid-min ng-valid ng-valid-required">
                                                            </div>
                                                        </td>

                                                        <td class="col-xs-2 text-right">会员卡卡号：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-3 validate_input">
                                                                <input style="width: 180px;" type="text" id="membershipcard"  class="form-control ng-pristine ng-valid">
                                                            </div>
                                                        </td>
                                                    </tr>

                                                    <tr>
                                                        <td class="col-xs-2 text-right">地址：</td>
                                                        <td class="col-xs-4 td-content " colspan="3">
                                                            <div class="col-xs-12 validate_input">
                                                                <input style="width: 38%; display: inline-block;" type="text" id="address" maxlength="128" ng-readonly="isReadonly" ng-model="clientVO.address" name="address" class="form-control ng-pristine ng-valid" placeholder="详细地址">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="text-right">备注：</td>
                                                        <td colspan="5">
                                                            <div>
                                                                <input type="text" id="remark" name="remark" class="form-control ng-pristine ng-valid">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">发货方式：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-4 validate_input">
                                                                <select name="integral" style="width: auto" class="form-control ng-pristine ng-valid"  id="integral">
                                                                    <option value="0">自提</option>
                                                                    <option value="1">送指定点</option>
                                                                    <option value="2">送车</option>
                                                                    <option value="3">发物流</option>
                                                                    <option value="4">电子面单</option>
                                                                </select>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </form>
                                        <form class="form-horizontal" name="edit" id="mo" novalidate="">
                                            <div>
                                                <table class="table table-bordered " id="mobile" style="display: none">
                                                    <tbody>
                                                    <tr>
                                                        <td class="col-xs-2 text-right"><span class="text-danger">* </span>客户名称：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" maxlength="30" id="name" name="name" ng-readonly="isReadonly" ng-model="clientVO.clientName" ng-remote-validate="/is/admin/inner/client/clientIsUnique.ac" class="form-control ng-pristine ng-valid-ng-remote-validate ng-invalid ng-invalid-required" required="" ng-change="changeSmCall()">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">客户类型：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-7 ">
                                                                <div style="display:inline-block;">
                                                                    <select class="form-control ng-pristine ng-valid" id="type" name="type">
                                                                        <option value="0">重点客户</option>
                                                                        <option value="1">普通客户</option>
                                                                        <option value="2">小客户</option>
                                                                        <option value="3">默认客户</option>
                                                                        <option value="4">新客户</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">手机：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="mobilephone" maxlength="128" name="mobilephone" class="form-control ng-pristine ng-valid ng-valid-pattern" placeholder="短信发送相关">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">昵称：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="nickname" maxlength="20" ng-readonly="isReadonly" ng-model="targetInfoVO.smCall" name="nickname" class="form-control ng-pristine ng-valid" placeholder="xxx先生/女士">
                                                            </div>
                                                        </td>

                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">性别：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" ng-model="clientVO.gender" value=1 id="sex" ng-disabled="isReadyOnly()" ng-change="changeSmCall()">男
                                                                &nbsp;&nbsp;
                                                                <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" ng-model="clientVO.gender" value=2 id="sex" ng-disabled="isReadyOnly()" ng-change="changeSmCall()">女
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">生日：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" class="form-control" id="datepicker" name="birthday" data-inputmask="'alias': 'dd/mm/yyyy'" data-mask>
                                                            </div>
                                                        </td>

                                                    </tr>

                                                    <tr>
                                                        <td class="col-xs-2 text-right">启用：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-4 validate_input">
                                                                <select name="status" style="width: auto" class="form-control ng-pristine ng-valid"  id="status">
                                                                    <option value="0">失效</option>
                                                                    <option value="1">启用</option>
                                                                </select>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <td class="col-xs-2 text-right">联系人：</td>
                                                    <td class="col-xs-4 td-content ">
                                                        <div class="col-xs-9 validate_input">
                                                            <input type="text" id="contacts" maxlength="20" name="contacts" class="form-control ng-pristine ng-valid">
                                                        </div>
                                                    </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">电话：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="phone" maxlength="128" name="phone" class="form-control ng-pristine ng-valid ng-valid-pattern" ng-pattern="/^[0-9-]*$/">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <td class="col-xs-2 text-right">邮箱：</td>
                                                    <td class="col-xs-4 td-content ">
                                                        <div class="col-xs-9 validate_input">
                                                            <input type="mail" id="mail" maxlength="128" name="email" class="form-control ng-pristine ng-valid ng-valid-email">
                                                        </div>
                                                    </td>
                                                    </tr>
                                                    <tr>

                                                        <td class="col-xs-2 text-right">传真：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="fax" maxlength="128" name="fax" class="form-control ng-pristine ng-valid ng-valid-pattern">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">银行账户：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="bankaccount" maxlength="128" name="bankaccount" class="form-control ng-pristine ng-valid">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">银行账号：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <input type="text" id="banknumber" maxlength="128" name="banknumber" ng-pattern="/^[0-9]*$/" class="form-control ng-pristine ng-valid ng-valid-pattern">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">开户行：</td>
                                                        <td class="col-xs-4 td-content">
                                                            <div class="col-xs-9 ">
                                                                <input type="text" id="openbank" maxlength="128" name="openbank" class="form-control ng-pristine ng-valid">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right ng-binding">
                                                            <span class="text-danger">* </span>
                                                            默认折扣(%)：
                                                        </td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-3 validate_input" style="height: 42px;">
                                                                <input type="number" id="discount" maxlength="128" style="width: auto" name="discount" min="-0.001" max="10000" ng-pattern="/^\d{0,5}\.?[0-9]{0,2}$/" class="form-control ng-pristine ng-valid-number ng-valid-max ng-valid-min ng-valid-pattern ng-valid ng-valid-required">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">建立时间：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-9 validate_input">
                                                                <p id="createTime" name="createTime"></p>
                                                            </div>
                                                        </td>
                                                    </tr>

                                                    <tr>
                                                        <td class="col-xs-2 text-right"><span class="text-danger">* </span>排序：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-3 validate_input">
                                                                <input type="number" style="width: auto" id="sort" max="1000000" name="sort" min="1" class="form-control ng-pristine ng-valid-number ng-valid-max ng-valid-min ng-valid ng-valid-required">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">会员卡卡号：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-3 validate_input">
                                                                <input style="width: 180px;" type="text" id="membershipcard" class="form-control ng-pristine ng-valid">
                                                            </div>
                                                        </td>
                                                    </tr>

                                                    <tr>
                                                        <td class="col-xs-2 text-right">地址：</td>
                                                        <td class="col-xs-4 td-content " colspan="3">
                                                            <div class="col-xs-12 validate_input">
                                                                <input style=" display: inline-block;" type="text" id="address" maxlength="128" ng-readonly="isReadonly" ng-model="clientVO.address" name="address" class="form-control ng-pristine ng-valid" placeholder="详细地址">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="text-right">备注：</td>
                                                        <td colspan="5">
                                                            <div>
                                                                <input type="text" id="remark" name="remark" class="form-control ng-pristine ng-valid">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-2 text-right">发货方式：</td>
                                                        <td class="col-xs-4 td-content ">
                                                            <div class="col-xs-4 validate_input">
                                                                <select name="integral" style="width: auto" class="form-control ng-pristine ng-valid"  id="integral">
                                                                    <option value="0">自提</option>
                                                                    <option value="1">送指定点</option>
                                                                    <option value="2">送车</option>
                                                                    <option value="3">发物流</option>
                                                                    <option value="4">电子面单</option>
                                                                </select>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </form>
                                    </div>

                                    <div class="btn-group" align="center" >
                                        <button class="btn-normal" onclick="addCustomer()">保存</button>
                                        <a href="/purchase/supplier" style="color: black"><button class="btn-normal">重置</button></a>
                                    </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
                <div class="col-md-8" th:if="${customer} ne null">
                    <div class="box">
                        <div class="box-header"  style="border-bottom: 1px dashed #ddd;">
                            <h3 class="box-title">基本信息 </h3>
                            <div style="float: right ">
                                <button type="button" class="btn btn-block btn-info" id="excell" onclick="method5('example2')">导出</button>
                            </div>
                            <div style="float: right ;margin-right:8px">
                                <a href="/sale/custom_management" style="color: white"> <button type="button" class="btn btn-block btn-info">新增客户</button></a>
                            </div>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <div class="panel-body">
                                <form class="form-horizontal ng-pristine ng-invalid ng-invalid-required"  id="epc" novalidate="">
                                    <div>
                                        <table class="table table-bordered " th:each="customer:${customer}" id="pcPage" style="display: none">
                                            <tbody><tr>
                                                <td class="col-xs-2 text-right"><span class="text-danger">* </span>客户名称：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" maxlength="30" id="name" th:value="${customer.name}" name="name" class="form-control ng-pristine ng-valid-ng-remote-validate ng-invalid ng-invalid-required" required="" ng-change="changeSmCall()">
                                                    </div>
                                                </td>

                                                <td class="col-xs-2 text-right">客户类型：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-7 ">
                                                        <div style="display:inline-block;">
                                                            <select class="form-control ng-pristine ng-valid" th:value="${customer.type}" id="type" name="type">
                                                                <option value="0" th:if="${customer.type=='0'}" th:selected="selected">重点客户</option>
                                                                <option value="0" th:if="${customer.type!='0'}">重点客户</option>
                                                                <option value="1" th:if="${customer.type=='1'}" th:selected="selected">普通客户</option>
                                                                <option value="1" th:if="${customer.type!='1'}">普通客户</option>
                                                                <option value="2" th:if="${customer.type=='2'}" th:selected="selected">小客户</option>
                                                                <option value="2" th:if="${customer.type!='2'}">小客户</option>
                                                                <option value="3" th:if="${customer.type=='3'}" th:selected="selected">默认客户</option>
                                                                <option value="3" th:if="${customer.type!='3'}">默认客户</option>
                                                                <option value="4" th:if="${customer.type=='4'}" th:selected="selected">新客户</option>
                                                                <option value="4" th:if="${customer.type!='4'}">新客户</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">手机：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="mobilephone" th:value="${customer.mobilephone}"  maxlength="128" name="mobilephone" class="form-control ng-pristine ng-valid ng-valid-pattern" placeholder="短信发送相关">
                                                    </div>
                                                </td>

                                                <td class="col-xs-2 text-right">昵称：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="nickname" th:value="${customer.nickname}" maxlength="20" name="nickname" class="form-control ng-pristine ng-valid" placeholder="xxx先生/女士">
                                                    </div>
                                                </td>

                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">性别：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input" th:switch="${customer.sex}">
                                                        <p th:case="true">
                                                            <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" id="sex" value=0 >男
                                                            &nbsp;&nbsp;
                                                            <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" id="sex" value=1 th:checked="checked">女
                                                        </p>
                                                        <p th:case="false">
                                                            <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" id="sex" value=0 th:checked="checked">男
                                                            &nbsp;&nbsp;
                                                            <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" id="sex" value=1>女
                                                        </p>
                                                    </div>
                                                </td>
                                                <td class="col-xs-2 text-right">生日：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 form-group validate_input">
                                                        <div class="input-group date">
                                                            <div class="input-group-addon">
                                                                <i class="fa fa-calendar"></i>
                                                            </div>
                                                            <input type="text" class="form-control pull-right" id="datepicker" name="birthday" th:value="${#dates.format(customer.birthday, 'dd/MM/yyyy')}">
                                                        </div>
                                                    </div>
                                                </td>

                                            </tr>

                                            <tr>
                                                <td class="col-xs-2 text-right">启用：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-4 validate_input">
                                                        <select name="status" style="width: auto" class="form-control ng-pristine ng-valid"  id="status">
                                                            <option value="0" th:if="${!customer.status}" th:selected="selected">失效</option>
                                                            <option value="0" th:if="${customer.status}">失效</option>
                                                            <option value="1" th:if="${!customer.status}">启用</option>
                                                            <option value="1" th:if="${customer.status}" th:selected="selected">启用</option>
                                                        </select>
                                                    </div>
                                                </td>

                                                <td class="col-xs-2 text-right">联系人：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="contacts" maxlength="20" th:value="${customer.contacts}" name="contacts" class="form-control ng-pristine ng-valid">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">电话：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="phone" maxlength="128" th:value="${customer.phone}" name="phone" class="form-controlng-pristine ng-valid ng-valid-pattern" placeholder="短信发送相关">
                                                    </div>
                                                </td>

                                                <td class="col-xs-2 text-right">邮箱：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="mail" id="mail" maxlength="128" th:value="${customer.mail}" name="mail" class="form-control ng-pristine ng-valid ng-valid-email">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>

                                                <td class="col-xs-2 text-right">传真：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="fax" maxlength="128" th:value="${customer.fax}"  name="fax" class="form-control ng-pristine ng-valid ng-valid-pattern">
                                                    </div>
                                                </td>

                                                <td class="col-xs-2 text-right">银行账户：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="bankaccount" maxlength="128" th:value="${customer.bankaccount}"  name="bankaccount" class="form-control ng-pristine ng-valid">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">银行账号：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="banknumber" maxlength="128" th:value="${customer.banknumber}" name="banknumber" ng-pattern="/^[0-9]*$/" class="form-control ng-pristine ng-valid ng-valid-pattern">
                                                    </div>
                                                </td>

                                                <td class="col-xs-2 text-right">开户行：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 ">
                                                        <input type="text" id="openbank" maxlength="128" th:value="${customer.openbank}" name="openbank" class="form-control ng-pristine ng-valid">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right ng-binding">
                                                    <span class="text-danger">* </span>
                                                    默认折扣(%)：
                                                </td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-3 validate_input" style="height: 42px;">
                                                        <input type="number" id="discount" maxlength="128" th:value="${customer.discount}" style="width: auto" name="discount" min="-0.001" max="10000" ng-pattern="/^\d{0,5}\.?[0-9]{0,2}$/" class="form-control ng-pristine ng-valid-number ng-valid-max ng-valid-min ng-valid-pattern ng-valid ng-valid-required">
                                                    </div>
                                                </td>

                                                <td class="col-xs-2 text-right">建立时间：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9">
                                                        <p id="createTime1" name="createTime1" th:text="${#dates.format(customer.settime, 'yyyy-MM-dd  HH:mm:ss')}"></p>
                                                    </div>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td class="col-xs-2 text-right"><span class="text-danger">* </span>排序：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-3 validate_input">
                                                        <input type="number" style="width: auto" th:value="${customer.sort}" id="sort" max="1000000" name="sort" min="1" class="form-control ng-pristine ng-valid-number ng-valid-max ng-valid-min ng-valid ng-valid-required">
                                                    </div>
                                                </td>

                                                <td class="col-xs-2 text-right">会员卡卡号：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-3 validate_input">
                                                        <input style="width: 180px;" type="text" th:value="${customer.membershipcard}" id="membershipcard"  class="form-control ng-pristine ng-valid">
                                                    </div>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td class="col-xs-2 text-right">地址：</td>
                                                <td class="col-xs-4 td-content " colspan="3">
                                                    <div class="col-xs-12 validate_input">
                                                        <input style="width: 38%; display: inline-block;" th:value="${customer.address}" type="text" id="address" maxlength="128" ng-readonly="isReadonly" ng-model="clientVO.address" name="address" class="form-control ng-pristine ng-valid" placeholder="详细地址">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="text-right">备注：</td>
                                                <td colspan="5">
                                                    <div>
                                                        <input type="text" id="remark" name="remark" th:value="${customer.remark}" class="form-control ng-pristine ng-valid">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">发货方式：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-4 validate_input">
                                                        <select name="integral" style="width: auto" th:value="${customer.integral}" class="form-control ng-pristine ng-valid"  id="integral">
                                                            <option value="0" th:if="${customer.integral==0}" th:selected="selected">自提</option>
                                                            <option value="0" th:if="${customer.integral!=0}" >自提</option>
                                                            <option value="1" th:if="${customer.integral==1}" th:selected="selected">送指定点</option>
                                                            <option value="1" th:if="${customer.integral!=1}" >送指定点</option>
                                                            <option value="2" th:if="${customer.integral==2}" th:selected="selected">送车</option>
                                                            <option value="2" th:if="${customer.integral!=2}" >送车</option>
                                                            <option value="3" th:if="${customer.integral!=3}" th:selected="selected">发物流</option>
                                                            <option value="3" th:if="${customer.integral!=3}">发物流</option>
                                                            <option value="4" th:if="${customer.integral==4}" th:selected="selected">电子面单</option>
                                                            <option value="4" th:if="${customer.integral!=4}">电子面单</option>
                                                        </select>
                                                    </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </form>
                                <form class="form-horizontal ng-pristine ng-invalid ng-invalid-required"  id="emo" novalidate="">
                                    <div>
                                        <table class="table table-bordered " id="mobile" style="display: none" th:each="customer:${customer}">
                                            <tbody>
                                            <tr>
                                                <td class="col-xs-2 text-right"><span class="text-danger">* </span>客户名称：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input" >
                                                        <input type="text" maxlength="30" id="name" name="name" th:value="${customer.name}"  ng-readonly="isReadonly" ng-model="clientVO.clientName" ng-remote-validate="/is/admin/inner/client/clientIsUnique.ac" class="form-control ng-pristine ng-valid-ng-remote-validate ng-invalid ng-invalid-required" required="" ng-change="changeSmCall()">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">客户类型：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-7 ">
                                                        <div style="display:inline-block;">
                                                            <select class="form-control ng-pristine ng-valid" th:value="${customer.type}" id="type" name="type">
                                                                <option value="0" th:if="${customer.type=='0'}" th:selected="selected">重点客户</option>
                                                                <option value="0" th:if="${customer.type!='0'}">重点客户</option>
                                                                <option value="1" th:if="${customer.type=='1'}" th:selected="selected">普通客户</option>
                                                                <option value="1" th:if="${customer.type!='1'}">普通客户</option>
                                                                <option value="2" th:if="${customer.type=='2'}" th:selected="selected">小客户</option>
                                                                <option value="2" th:if="${customer.type!='2'}">小客户</option>
                                                                <option value="3" th:if="${customer.type=='3'}" th:selected="selected">默认客户</option>
                                                                <option value="3" th:if="${customer.type!='3'}">默认客户</option>
                                                                <option value="4" th:if="${customer.type=='4'}" th:selected="selected">新客户</option>
                                                                <option value="4" th:if="${customer.type!='4'}">新客户</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">手机：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="mobilephone" th:value="${customer.mobilephone}" maxlength="128" name="mobilephone" class="form-control ng-pristine ng-valid ng-valid-pattern" placeholder="短信发送相关">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">昵称：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="nickname" th:value="${customer.nickname}" maxlength="20" ng-readonly="isReadonly" ng-model="targetInfoVO.smCall" name="nickname" class="form-control ng-pristine ng-valid" placeholder="xxx先生/女士">
                                                    </div>
                                                </td>

                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">性别：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input" th:switch="${customer.sex}">
                                                        <p th:case="true">
                                                            <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" id="sex" value=0 >男
                                                            &nbsp;&nbsp;
                                                            <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" id="sex" value=1 th:checked="checked">女
                                                        </p>
                                                        <p th:case="false">
                                                            <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" id="sex" value=0 th:checked="checked">男
                                                            &nbsp;&nbsp;
                                                            <input class="sel-a ng-pristine ng-valid" type="radio" name="sex" id="sex" value=1>女
                                                        </p>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">生日：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" class="form-control" th:value="${#dates.format(customer.birthday, 'dd/MM/yyyy')}" id="datepicker" name="birthday" data-inputmask="'alias': 'dd/mm/yyyy'" data-mask>
                                                    </div>
                                                </td>

                                            </tr>

                                            <tr>
                                                <td class="col-xs-2 text-right">启用：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-4 validate_input">
                                                        <select name="status" style="width: auto" class="form-control ng-pristine ng-valid"  id="status">
                                                            <option value="0" th:if="${!customer.status}" th:selected="selected">失效</option>
                                                            <option value="0" th:if="${customer.status}">失效</option>
                                                            <option value="1" th:if="${!customer.status}">启用</option>
                                                            <option value="1" th:if="${customer.status}" th:selected="selected">启用</option>
                                                        </select>
                                                    </div>
                                                </td>
                                            </tr>
                                            <td class="col-xs-2 text-right">联系人：</td>
                                            <td class="col-xs-4 td-content ">
                                                <div class="col-xs-9 validate_input">
                                                    <input type="text" id="contacts" maxlength="20" th:value="${customer.contacts}" name="contacts" class="form-control ng-pristine ng-valid">
                                                </div>
                                            </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">电话：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="phone" maxlength="128"  th:value="${customer.phone}"  name="phone" class="form-control ng-pristine ng-valid ng-valid-pattern" ng-pattern="/^[0-9-]*$/">
                                                    </div>
                                                </td>
                                            </tr>
                                            <td class="col-xs-2 text-right">邮箱：</td>
                                            <td class="col-xs-4 td-content ">
                                                <div class="col-xs-9 validate_input">
                                                    <input type="mail" id="mail" maxlength="128" th:value="${customer.mail}" name="email" class="form-control ng-pristine ng-valid ng-valid-email">
                                                </div>
                                            </td>
                                            </tr>
                                            <tr>

                                                <td class="col-xs-2 text-right">传真：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="fax" maxlength="128" th:value="${customer.fax}" name="fax" class="form-control ng-pristine ng-valid ng-valid-pattern">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">银行账户：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="bankaccount" maxlength="128" th:value="${customer.bankaccount}" name="bankaccount" class="form-control ng-pristine ng-valid">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">银行账号：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <input type="text" id="banknumber" maxlength="128" th:value="${customer.banknumber}" name="banknumber" ng-pattern="/^[0-9]*$/" class="form-control ng-pristine ng-valid ng-valid-pattern">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">开户行：</td>
                                                <td class="col-xs-4 td-content">
                                                    <div class="col-xs-9 ">
                                                        <input type="text" id="openbank" maxlength="128" name="openbank" th:value="${customer.openbank}" class="form-control ng-pristine ng-valid">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right ng-binding">
                                                    <span class="text-danger">* </span>
                                                    默认折扣(%)：
                                                </td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-3 validate_input" style="height: 42px;">
                                                        <input type="number" id="discount" maxlength="128" th:value="${customer.discount}" style="width: auto" name="discount" min="-0.001" max="10000" ng-pattern="/^\d{0,5}\.?[0-9]{0,2}$/" class="form-control ng-pristine ng-valid-number ng-valid-max ng-valid-min ng-valid-pattern ng-valid ng-valid-required">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">建立时间：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-9 validate_input">
                                                        <p id="createTime" name="createTime" th:text="${#dates.format(customer.settime, 'yyyy-MM-dd  HH:mm:ss')}"></p>
                                                    </div>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td class="col-xs-2 text-right"><span class="text-danger">* </span>排序：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-3 validate_input">
                                                        <input type="number" style="width: auto" th:value="${customer.sort}" id="sort" max="1000000" name="sort" min="1" class="form-control ng-pristine ng-valid-number ng-valid-max ng-valid-min ng-valid ng-valid-required">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">会员卡卡号：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-3 validate_input">
                                                        <input style="width: 180px;" type="text" id="membershipcard" th:value="${customer.membershipcard}"  class="form-control ng-pristine ng-valid">
                                                    </div>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td class="col-xs-2 text-right">地址：</td>
                                                <td class="col-xs-4 td-content " colspan="3">
                                                    <div class="col-xs-12 validate_input">
                                                        <input style=" display: inline-block;" th:value="${customer.address}" type="text" id="address" maxlength="128" ng-readonly="isReadonly" ng-model="clientVO.address" name="address" class="form-control ng-pristine ng-valid" placeholder="详细地址">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="text-right">备注：</td>
                                                <td colspan="5">
                                                    <div>
                                                        <input type="text" id="remark" th:value="${customer.remark}" name="remark" class="form-control ng-pristine ng-valid">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="col-xs-2 text-right">发货方式：</td>
                                                <td class="col-xs-4 td-content ">
                                                    <div class="col-xs-4 validate_input">
                                                        <select name="integral" style="width: auto" th:value="${customer.integral}" class="form-control ng-pristine ng-valid"  id="integral">
                                                            <option value="0" th:if="${customer.integral==0}" th:selected="selected">自提</option>
                                                            <option value="0" th:if="${customer.integral!=0}" >自提</option>
                                                            <option value="1" th:if="${customer.integral==1}" th:selected="selected">送指定点</option>
                                                            <option value="1" th:if="${customer.integral!=1}" >送指定点</option>
                                                            <option value="2" th:if="${customer.integral==2}" th:selected="selected">送车</option>
                                                            <option value="2" th:if="${customer.integral!=2}" >送车</option>
                                                            <option value="3" th:if="${customer.integral!=3}" th:selected="selected">发物流</option>
                                                            <option value="3" th:if="${customer.integral!=3}">发物流</option>
                                                            <option value="4" th:if="${customer.integral==4}" th:selected="selected">电子面单</option>
                                                            <option value="4" th:if="${customer.integral!=4}">电子面单</option>
                                                        </select>
                                                    </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </form>
                                <div class="btn-group" align="center " th:each="customer:${customer}">
                                    <button class="btn-normal" th:onclick="javascript:updateCustomer([[${customer.id}]]);">保存</button>
                                    <a href="/sale/custom_management" style="color: black"><button class="btn-normal">重置</button></a>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
            </section>
            <!-- /.content -->
        </div>
    </div>
    <!-- /.content-wrapper -->
    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> 2.4.0
        </div>
        <strong>Copyright &copy; 2014-2016 <a href="https://adminlte.io">Almsaeed Studio</a>.</strong> All rights
        reserved.
    </footer>
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Create the tabs -->
        <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
            <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
            <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <!-- Home tab content -->
            <div class="tab-pane" id="control-sidebar-home-tab">
                <h3 class="control-sidebar-heading">Recent Activity</h3>
                <ul class="control-sidebar-menu">
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-birthday-cake bg-red"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>

                                <p>Will be 23 on April 24th</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-user bg-yellow"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>

                                <p>New phone +1(800)555-1234</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-envelope-o bg-light-blue"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>

                                <p>nora@example.com</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-file-code-o bg-green"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>

                                <p>Execution time 5 seconds</p>
                            </div>
                        </a>
                    </li>
                </ul>
                <!-- /.control-sidebar-menu -->

                <h3 class="control-sidebar-heading">Tasks Progress</h3>
                <ul class="control-sidebar-menu">
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Custom Template Design
                                <span class="label label-danger pull-right">70%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Update Resume
                                <span class="label label-success pull-right">95%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-success" style="width: 95%"></div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Laravel Integration
                                <span class="label label-warning pull-right">50%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-warning" style="width: 50%"></div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Back End Framework
                                <span class="label label-primary pull-right">68%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-primary" style="width: 68%"></div>
                            </div>
                        </a>
                    </li>
                </ul>
                <!-- /.control-sidebar-menu -->

            </div>
            <!-- /.tab-pane -->
            <!-- Stats tab content -->
            <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
            <!-- /.tab-pane -->
            <!-- Settings tab content -->
            <div class="tab-pane" id="control-sidebar-settings-tab">
                <form method="post">
                    <h3 class="control-sidebar-heading">General Settings</h3>

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Report panel usage
                            <input type="checkbox" class="pull-right" checked>
                        </label>

                        <p>
                            Some information about this general settings option
                        </p>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Allow mail redirect
                            <input type="checkbox" class="pull-right" checked>
                        </label>

                        <p>
                            Other sets of options are available
                        </p>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Expose author name in posts
                            <input type="checkbox" class="pull-right" checked>
                        </label>

                        <p>
                            Allow the user to show his name in blog posts
                        </p>
                    </div>
                    <!-- /.form-group -->

                    <h3 class="control-sidebar-heading">Chat Settings</h3>

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Show me as online
                            <input type="checkbox" class="pull-right" checked>
                        </label>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Turn off notifications
                            <input type="checkbox" class="pull-right">
                        </label>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Delete chat history
                            <a href="javascript:void(0)" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
                        </label>
                    </div>
                    <!-- /.form-group -->
                </form>
            </div>
            <!-- /.tab-pane -->
        </div>
    </aside>
    <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script src="../../bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="../../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Select2 -->
<script src="../../bower_components/select2/dist/js/select2.full.min.js"></script>
<!-- InputMask -->
<script src="../../plugins/input-mask/jquery.inputmask.js"></script>
<script src="../../plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="../../plugins/input-mask/jquery.inputmask.extensions.js"></script>
<!-- date-range-picker -->
<script src="../../bower_components/moment/min/moment.min.js"></script>
<script src="../../bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- bootstrap datepicker -->
<script src="../../bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<!-- bootstrap color picker -->
<script src="../../bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
<!-- bootstrap time picker -->
<script src="../../plugins/timepicker/bootstrap-timepicker.min.js"></script>
<!-- SlimScroll -->
<script src="../../bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- iCheck 1.0.1 -->
<script src="../../plugins/iCheck/icheck.min.js"></script>
<!-- FastClick -->
<script src="../../bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<!-- DataTables -->
<script src="../../bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="../../bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- FastClick -->
<script src="../../bower_components/fastclick/lib/fastclick.js"></script>
<script>
    $(function () {
        //Initialize Select2 Elements
        $('.select2').select2()

        //Datemask dd/mm/yyyy
        $('#datemask').inputmask('dd/mm/yyyy', { 'placeholder': 'dd/mm/yyyy' })
        //Datemask2 mm/dd/yyyy
        $('#datemask2').inputmask('mm/dd/yyyy', { 'placeholder': 'mm/dd/yyyy' })
        //Money Euro
        $('[data-mask]').inputmask()

        //Date range picker
        $('#reservation').daterangepicker()
        //Date range picker with time picker
        $('#reservationtime').daterangepicker({ timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A' })
        //Date range as a button
        $('#daterange-btn').daterangepicker(
            {
                ranges   : {
                    'Today'       : [moment(), moment()],
                    'Yesterday'   : [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                    'Last 7 Days' : [moment().subtract(6, 'days'), moment()],
                    'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                    'This Month'  : [moment().startOf('month'), moment().endOf('month')],
                    'Last Month'  : [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
                },
                startDate: moment().subtract(29, 'days'),
                endDate  : moment()
            },
            function (start, end) {
                $('#daterange-btn span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'))
            }
        )

        //Date picker
        $('#datepicker').datepicker({
            autoclose: true
        })

        //Timepicker
        $('.timepicker').timepicker({
            showInputs: false
        })
    })
    $(function () {
        $('#example1').DataTable()
        $('#example2').DataTable({
            'paging'      : false,
            'lengthChange': false,
            'searching'   : true,
            'ordering'    : false,
            'info'        : false,
            'autoWidth'   : true
        })
    })
    //打印表格
    var idTmr;
    function getExplorer() {
        var explorer = window.navigator.userAgent;
        //ie
        if(explorer.indexOf("MSIE") >= 0) {
            return 'ie';
        }
        //firefox
        else if(explorer.indexOf("Firefox") >= 0) {
            return 'Firefox';
        }
        //Chrome
        else if(explorer.indexOf("Chrome") >= 0) {
            return 'Chrome';
        }
        //Opera
        else if(explorer.indexOf("Opera") >= 0) {
            return 'Opera';
        }
        //Safari
        else if(explorer.indexOf("Safari") >= 0) {
            return 'Safari';
        }
    }
    function method5(tableid) {
        if(getExplorer() == 'ie') {
            var curTbl = document.getElementById(tableid);
            var oXL = new ActiveXObject("Excel.Application");
            var oWB = oXL.Workbooks.Add();
            var xlsheet = oWB.Worksheets(1);
            var sel = document.body.createTextRange();
            sel.moveToElementText(curTbl);
            sel.select();
            sel.execCommand("Copy");
            xlsheet.Paste();
            oXL.Visible = true;

            try {
                var fname = oXL.Application.GetSaveAsFilename("Excel.xls",
                    "Excel Spreadsheets (*.xls), *.xls");
            } catch(e) {
                print("Nested catch caught " + e);
            } finally {
                oWB.SaveAs(fname);
                oWB.Close(savechanges = false);
                oXL.Quit();
                oXL = null;
                idTmr = window.setInterval("Cleanup();", 1);
            }

        } else {
            tableToExcel(tableid)
        }
    }
    function Cleanup() {
        window.clearInterval(idTmr);
        CollectGarbage();
    }
    var tableToExcel = (function() {
        var uri = 'data:application/vnd.ms-excel;base64,',
            template = '<html><head><meta charset="UTF-8"></head><body><table  border="1">{table}</table></body></html>',
            base64 = function(
                s) {
                return window.btoa(unescape(encodeURIComponent(s)))
            },
            format = function(s, c) {
                return s.replace(/{(\w+)}/g, function(m, p) {
                    return c[p];
                })
            }
        return function(table, name) {
            if(!table.nodeType)
                table = document.getElementById(table)
            var ctx = {
                worksheet: name || 'Worksheet',
                table: table.innerHTML
            }
            window.location.href = uri + base64(format(template, ctx))
        }
    })()

    var date = new Date(+new Date()+8*3600*1000).toISOString().replace(/T/g,' ').replace(/\.[\d]{3}Z/,'')
    document.getElementById("createTime").innerHTML=date;
    //document.getElementById("createTime1").innerHTML=date;

    function addCustomer() {
        if (IsPC()) {
            $.ajax({
                url: "/custom_management/addCustomer",
                type: "POST",
                async:false,
                data: $("#pc").serialize(),
                success:function (data) {
                    if (data.code == 1) {
                        window.location.href = "/sale/custom_management";
                        alert("添加成功");
                    } else {
                        alert(data.msg);
                    }
                }
            })
        } else {
            $.ajax({
                url: "/custom_management/addCustomer",
                type: "POST",
                async:false,
                data: $("#mo").serialize(),
                success:function (data) {
                    if (data.code == 1) {
                        window.location.href = "/sale/custom_management";
                        alert("添加成功");
                    } else {
                        alert(data.msg);
                    }
                }
            })
        }
    }
    function deleteCustomer(customersId) {
        $.ajax({
            url:"/custom_management/deleteCustomers",
            type:'POST',
            data:{
                customersId:customersId
            },
            success:function (data) {
                if (data.code == 1) {
                    window.location.href = "/sale/custom_management";
                    alert("删除成功");
                } else {
                    alert(data.msg);
                }
            }
        })
    }

    function updateCustomer(id) {
        if (IsPC()) {
            var dataParam = $("#epc").serialize();
            dataParam+="&id="+id;
            $.ajax({
                url:"/custom_management/updateCustomer",
                type:'POST',
                data:dataParam,
                success:function (data) {
                    if (data.code == 1) {
                        window.location.href = "/sale/custom_management";
                        alert("修改成功");
                    } else {
                        alert(data.msg);
                    }
                }
            })
        }
        else {
            var dataParam = $("#emo").serialize();
            dataParam+="&id="+id;
            $.ajax({
                url:"/custom_management/updateCustomer",
                type:'POST',
                data:dataParam,
                success:function (data) {
                    if (data.code == 1) {
                        window.location.href = "/sale/custom_management";
                        alert("修改成功");
                    } else {
                        alert(data.msg);
                    }
                }
            })
        }

    }

    //分离pc与移动
    function IsPC() {
        var userAgentInfo = navigator.userAgent;//获取当前浏览器的信息
        var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];

        var flag = true;
        for (var i = 0; i < Agents.length; i++) {
            if (userAgentInfo.indexOf(Agents[i]) > 0) {//判断是否是移动端
                flag = false;
                break;
            }
        }
        return flag;
    }

    $(document).ready(function () {
        if (IsPC()) {
            $("#pcPage").show();//pc端页面显示
        } else {
            $("#mobile").show();
        }
    })
</script>

</body>
</html>
